#include "RobotMapSystem.h"

/*
*   重写QGraphicsView
*/
MapView::MapView(QWidget *parent) :
    QGraphicsView(parent)
{

}

void MapView::mouseMoveEvent(QMouseEvent *event)
{
    QPoint point = event->pos();
    emit mouseMovePoint(point); //释放信号
    QGraphicsView::mouseMoveEvent(event);
}

void MapView::mousePressEvent(QMouseEvent *event)
{
    if (event->button() == Qt::LeftButton) {
        QPoint point = event->pos();
        emit mouseClicked(point);
    }
    QGraphicsView::mousePressEvent(event);
}

/*
*   重写QGraphicsScene
*/
MapScene::MapScene(QObject *parent) :
    QGraphicsScene(parent)
{

}

MapScene::MapScene(const QRectF &sceneRect, QObject *parent) :
    QGraphicsScene(sceneRect, parent)
{

}

MapScene::MapScene(qreal x, qreal y, qreal width, qreal height, QObject *parent) :
    QGraphicsScene(x, y, width, height, parent)
{

}


